<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>bosdyn.client.estop &mdash; Spot 5.0.1.1 documentation</title>
      <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../../../_static/style.css" type="text/css" />
    <link rel="shortcut icon" href="../../../_static/bd-favicon.png"/>
    <link rel="canonical" href="https://dev.bostondynamics.com/_modules/bosdyn/client/estop.html" />
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    <script src="../../../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../../README.html">
            
              <img src="../../../_static/bd-official-white.png" class="logo" alt="Logo"/>
          </a>
              <div class="version">
                5.0.1.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/concepts/README.html">Concepts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/about_spot.html">About Spot</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/orbit/about_orbit.html">About Orbit (formerly Scout)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/orbit/orbit_api.html">Orbit API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/networking.html">Networking</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/base_services.html">Base services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/geometry_and_frames.html">Geometry and Frames</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/robot_services.html">Robot services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/estop_service.html">E-Stop</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/keepalive_service.html">KeepAlive (BETA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/audio_visual.html">Audio Visual</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/lease_service.html">Lease</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/developing_api_services.html">Developing API Services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/service_customization.html">Service Customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/faults.html">Faults</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/autonomy/README.html">Autonomy services</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_tech_summary.html">Autonomy Technical Summary</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autonomous_navigation_code_examples.html">Autonomous navigation code examples</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/components_of_autonomous_navigation.html">Components of autonomous navigation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/docking.html">Docking</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/typical_autonomous_navigation_use_case.html">Typical autonomous navigation use case</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autonomous_navigation_services.html">Autonomous navigation services</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_service.html">GraphNav service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_map_structure.html">GraphNav map structure</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_area_callbacks.html">GraphNav area callbacks</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/initialization.html">Initialization</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/localization.html">Localization</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/graphnav_and_robot_locomotion.html">GraphNav and robot locomotion</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/missions_service.html">Missions service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/autowalk_service.html">Autowalk service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/network_compute_bridge.html">Network compute bridge</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/auto_return.html">AutoReturn service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/directed_exploration.html">Directed Exploration</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/autonomy/gps.html">GPS</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/choreography/README.html">Choreography</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_service.html">Choreography Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/move_reference.html">Move Reference Guide</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/custom_gait.html">CustomGait Reference</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreographer_setup.html">Choreographer Setup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreographer.html">Choreographer Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/robot_controls_in_choreographer.html">Robot Connections in Choreographer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/animations_in_choreographer.html">Animations in Choreography</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/animation_file_specification.html">Animation File Format</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_in_tablet.html">Tablet Choreography Mode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/choreography/choreography_in_autowalk.html">Choreography Actions in Autowalk</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/joint_control/README.html">Joint Control API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/joint_control/supplemental_data.html">Supplemental Robot Information</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../docs/concepts/joint_control/knee_torque_limits.html">Knee Torque Limits</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/arm/README.html">Spot Arm</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_specification.html">Arm and Gripper Specification</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_concepts.html">Concepts</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/arm/arm_services.html">Services</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/concepts/data.html">Spot Data</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_overview.html">Data Acquisition Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_output.html">Data Acquisition Output</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/writing_services_for_data_acquisition.html">Integrate Payloads with the API</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_buffer_overview.html">Data Buffer Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/bddf.html">BDDF File Format</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/concepts/data_acquisition_thermal_raw.html">Thermal Raw Data Format</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/python/README.html">Python</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/quickstart.html">Quickstart</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/understanding_spot_programming.html">Understanding Spot Programming</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../python/examples/README.html">Examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/basic_service_examples.html">Basic Service Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/hello_spot/README.html">Hello Spot</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/directory/README.html">Directory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_robot_state/README.html">Get Robot State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_robot_state_async/README.html">Get Robot State Async</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_world_objects/README.html">Get World Objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_mission_state/README.html">Get Mission State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/estop/README.html">E-Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/time_sync/README.html">Time Sync</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_test/README.html">Comms Test</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/disable_ir_emission/README.html">IR Enable/Disable</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/reset_safety_stop/README.html">Reset Safety Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/audio_visual/audio_visual_params/README.html">Audio Visual Params</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/audio_visual/audio_visual_behaviors/README.html">Audio Visual Behaviors</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/robot_behavior_examples.html">Robot Behavior and Commands Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/stance/README.html">Stance</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/frame_trajectory_command/README.html">Frame Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_light/README.html">Spot Light</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/upload_choreographed_sequence/README.html">Upload Choreographed Sequence</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/xbox_controller/README.html">Xbox Controller</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/wasd/README.html">WASD</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/docking/README.html">Docking</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/animation_recorder/README.html">Animation Recorder</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/auto_return/README.html">Auto Return</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/fan_command/README.html">Fan Commands</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_wasd/README.html">ARM WASD</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/arm_examples.html">Arm Command Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_simple/README.html">Simple Arm Motion</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_stow_unstow/README.html">Stow/unstow Arm</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_freeze/README.html">Arm Freeze</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_and_mobility_command/README.html">Arm and Mobility Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_with_body_follow/README.html">Arm Command with Body Following</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_constrained_manipulation/README.html">Arm Constrained Manipulation</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_trajectory/README.html">Arm Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_trajectory/README.html#long-trajectory">Long Trajectory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_joint_move/README.html">Arm Joint Move Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_force_control/README.html">Arm Force Control Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_grasp/README.html">Arm Grasp Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_grasp_carry_overrides/README.html">Arm Grasp and Carry Overrides</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_gaze/README.html">Arm Gaze Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_surface_contact/README.html">Arm Command with Surface Contact</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_door/README.html">Arm Door Opening Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_walk_to_object/README.html">Walk to And Pick Up Object</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_gcode/README.html">Writing Gcode</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gripper_camera_params/README.html">Gripper Camera Parameters</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_impedance_control/README.html">Arm Impedance Control</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/inverse_kinematics/README.html">Inverse Kinematics</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/arm_wasd/README.html">Arm WASD</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/joint_control/README.html">Wiggle Arm</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/payloads_examples.html">Payloads and Registration Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/payloads/README.html">Payloads</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/self_registration/README.html">Self Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_faults/README.html">Faults</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/velodyne_client/README.html">Velodyne</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/core_io_gpio/README.html">CORE I/O GPIO</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html">Overview</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#usage">Usage</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#components">Components</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/metrics_over_coreio/README.html#recommended-debugging">Recommended debugging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/extensions/README.html">Extensions</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/perception_world_objects_examples.html">Perception and World Objects Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_world_objects/README.html">Get World Objects</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/world_object_with_image_coordinates/README.html">World Object With Image Coordinates</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/world_object_mutations/README.html">World Object Mutations</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/visualizer/README.html">Visualizer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gripper_camera_params/README.html">Gripper Camera Parameters</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_cam/README.html">Spot CAM Services</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_cam/README.html#spot-cam-video-core-io-extension-example">Spot Cam Video Core IO Extension Example</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/stitch_front_images/README.html">Stitch Front Images</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_depth_plus_visual_image/README.html">Project Depth Data on Visual Images</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_image_server/README.html">Custom Parameter Image Server</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/fiducial_follow/README.html">Fiducial Follow</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/spot_tensorflow_detector/README.html">Tensorflow Detector</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_ncb_worker/README.html">Custom Parameter Tensorflow Detector</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_compute_bridge/README.html">Machine Learning with the Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_compute_bridge/fire_extinguisher_server/README.html">Fire Extinguisher Detector with the Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/ray_cast/README.html">Ray Cast</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/user_nogo_regions/README.html">No-Go Regions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/gps_service/README.html">GPS</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/logging_examples.html">Logging Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/bddf_download/README.html">BDDF Download</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_buffer/README.html">Data Buffer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_service/README.html">Data Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/logging/README.html">Logging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/log_status/README.html">Log Status</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/data_acquisition_examples.html">Data Acquisition Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_acquisition_service/README.html">Data Acquisition Service</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/examples/data_acquisition_service/signals_coreio_modem_plugin/README.html">Modem Signals</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_faults/README.html">Faults</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameter_image_server/README.html">Custom Parameter Image Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/service_customization/custom_parameters_data_acquisition/README.html">Custom Parameter Data Acquisition Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_image/README.html">Test Image Service Implementation with Get Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/post_docking_callbacks/README.html">Post Docking Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/cloud_upload/README.html">Cloud Upload</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_mapping/README.html">Comms image service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/comms_mapping/README.html#how-to-use">How to use</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/data_acquisition_service/signals_coreio_modem_plugin/README.html">CoreIO Modem Signals Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/tester_programs/README.html">Tester Programs</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/autonomy_and_missions_examples.html">Autonomy and Missions Examples</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_anchoring_optimization/README.html">Graph Nav Anchoring Optimization</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_command_line/README.html">GraphNav and Recording Service Command Line Interfaces</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_command_line/README.html#example-programs">Example Programs</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_extract_point_cloud/README.html">Graph Nav Extract Point Cloud</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_view_map/README.html">Graph Nav View Map</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/graph_nav_view_gps/README.html">Graph Nav View GPS Data</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/get_mission_state/README.html">Get Mission State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/remote_mission_service/README.html">Remote Mission Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/mission_question_answerer/README.html">Mission Question Answerer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/mission_recorder/README.html">Mission Recorder</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/replay_mission/README.html">Replay Mission</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/post_docking_callbacks/README.html">Post Docking Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/area_callback/README.html">Area Callbacks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/edit_autowalk/README.html">Edit Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/record_autowalk/README.html">Record Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/extract_images_from_walk/README.html">Extract Images from Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_request_callback/README.html">Network Request Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/network_request_callback/README.html#id1">Network Request Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/remote_mission_service/spot_check/README.html">SpotCheck Mission Service</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/joint_control_examples.html">Joint Control API Examples</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/examples/docs/orbit.html">Orbit</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/hello_orbit/README.html">Hello Orbit</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/export_run_archives/README.html">Export Run Archives</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/export_site_walk_archives/README.html">Export Sitewalk Archives</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/anomalies/README.html">Anomalies</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/schedule_mission/README.html">Schedule Mission</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/runs_response/README.html">Runs Response</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/send_robot_back_to_dock/README.html">Return to Dock</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/toggle_mission_based_on_weather/README.html">Mission Toggle</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook/README.html">Webhook</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/backups/README.html">Backups</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook_integration/README.html">Webhook Integrations</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/examples/orbit/webhook_integration/README.html#example-overview">Example Overview</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../python/README.html">Python Reference Guide</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/README.html">Client</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback.html">Area Callback</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_region_handler_base.html">Area Callback Region Handler</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_runner.html">Area Callback Service Runner</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_servicer.html">Area Callback Servicer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/area_callback_service_utils.html">Area Callback Service Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/arm_surface_contact.html">Arm Surface Contact</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/async_tasks.html">Async Tasks</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/audio_visual.html">Audio Visual</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/audio_visual_helpers.html">Audio Visual Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/auth.html">Auth</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/auto_return.html">Auto Return</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/autowalk.html">Autowalk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/bddf.html">BDDF</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/bddf_download.html">BDDF Download</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/channel.html">Channel</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/command_line.html">Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/common.html">Common</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition.html">Data Acquisition</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_helpers.html">Data Acquisition Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_plugin.html">Data Acquisition Plugin</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_plugin_service.html">Data Acquisition Plugin Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_acquisition_store.html">Data Acquisition Store</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_buffer.html">Data Buffer</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_chunk.html">Data Chunk</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/data_service.html">Data Service</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/directory_registration.html">Directory Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/directory.html">Directory</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/docking.html">Docking</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/door.html">Door</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html">E-Stop</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/error_callback_result.html">Error Callback Result</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/exceptions.html">Exceptions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/fault.html">Fault</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/frame_helpers.html">Frame Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/graph_nav.html">Graph Nav</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gripper_camera_param.html">Gripper Camera Params</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/README.html">GPS</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/aggregator_client.html">Aggregator Client</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/gps_listener.html">GPS Listener</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/NMEAParser.html">NMEA Parser</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/ntrip_client.html">NTRIP Client</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/gps/registration_client.html">Registration Client</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/image.html">Image</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/image_service_helpers.html">Image Service Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/inverse_kinematics.html">Inverse Kinematics</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/ir_enable_disable.html">IR Enable/Disable</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/keepalive.html">Keep Alive</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease.html">Lease</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease_resource_hierarchy.html">Lease Resource Hierarchy</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/lease_validator.html">Lease Validator</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/license.html">License</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/local_grid.html">Local Grid</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/log_status.html">Log Status</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/math_helpers.html">Math Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/manipulation_api_client.html">Manipulation API</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/map_processing.html">Map Processing</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/metrics_logging.html">Metrics Logging</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/network_compute_bridge_client.html">Network Compute Bridge</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_registration.html">Payload Registration</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_software_update.html">Payload Software Update</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload_software_update_initiation.html">Payload Software Update Initiation</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/payload.html">Payload</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/point_cloud.html">Point Cloud</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/power.html">Power</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/processors.html">Processors</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/ray_cast.html">Ray casting</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/recording.html">Recording</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_command.html">Robot Command</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_id.html">Robot ID</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot.html">Robot</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/robot_state.html">Robot State</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/sdk.html">SDK</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/server_util.html">Server Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/service_customization_helpers.html">Service Customization Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/signals_helpers.html">Signals Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/README.html">Spot CAM</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/audio.html">Audio</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/compositor.html">Compositor</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/health.html">Health</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/lighting.html">Lighting</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/lights_helper.html">Lights Helper</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/media_log.html">Media Log</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/network.html">Network</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/power.html">Power</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/ptz.html">PTZ</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/streamquality.html">Stream Quality</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_cam/version.html">Version</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/spot_check.html">Spot Check</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/time_sync.html">Time Sync</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/token_cache.html">Token Cache</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/token_manager.html">Token Manager</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/units_helpers.html">Units Helpers</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/util.html">Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-client/src/bosdyn/client/world_object.html">World Object</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/README.html">Core</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/README.html">BDDF</a><ul>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/base_data_reader.html">Base Data Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/block_writer.html">Block Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/bosdyn.html">BDDF Conventions</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/common.html">Common</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/data_reader.html">Data Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/data_writer.html">Data Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/file_indexer.html">File Indexer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_proto_reader.html">GRPC Proto Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_reader.html">GRPC Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_service_reader.html">GRPC Service Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/grpc_service_writer.html">GRPC Service Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/message_reader.html">Message Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/pod_series_reader.html">POD Series Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/pod_series_writer.html">POD Series Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_channel_reader.html">Protobuf Channel Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_reader.html">Protobuf Reader</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/protobuf_series_writer.html">Protobuf Series Writer</a></li>
<li class="toctree-l5"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/bddf/stream_data_reader.html">Stream Data Reader</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/geometry.html">Geometry</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/util.html">Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-core/src/bosdyn/deprecated.html">Deprecated</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/README.html">Mission</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/constants.html">Constants</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/exceptions.html">Exceptions</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/remote_client.html">Remote Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/server_util.html">Server Util</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-mission/src/bosdyn/mission/util.html">Util</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/README.html">Choreography</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/choreography.html">Choreography</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/animation_file_to_proto.html">Animation File to Proto</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-choreography-client/src/bosdyn/choreography/client/animation_file_conversion_helpers.html">Animation File to Proto Helpers</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/README.html">Orbit (formerly Scout)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/utils.html">Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-orbit/src/bosdyn/orbit/exceptions.html">Exceptions</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/README.html">Scout (deprecated)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/client.html">Client</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/utils.html">Utils</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../../python/bosdyn-scout/src/bosdyn/scout/exceptions.html">Exceptions</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch1.html">Fetch Tutorial</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch2.html">Part 2: Training the Model</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch3.html">Part 3: Evaluating the Model</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch4.html">Part 4: Autonomous Pick Up</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch5.html">Part 5: Detecting People and Playing Fetch</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/fetch_tutorial/fetch6.html">Part 6: Running the model on Core IO</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq1.html">Data Collection Tutorial</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq2.html">Part 2: Capturing images</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq3.html">Part 3: Capturing other data</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq4.html">Part 4: Deploying to the CORE I/O</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq5.html">Part 5: Collecting data</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/python/daq_tutorial/daq6.html">Part 6: Processing collected data</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/payload/README.html">Payloads</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/payload_configuration_requirements.html">Payload configuration requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/mechanical_interfaces.html">Mechanical interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/robot_mounting_rails.html">Robot mounting rails</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/guidelines_for_robust_payload_design.html">Guidelines for robust payload design</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/robot_electrical_interface.html">Robot electrical interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/coreio_documentation.html">CORE I/O Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/coreio_openvpn_extension.html">CORE I/O OpenVPN Extension</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/configuring_payload_software.html">Configuring payload software</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/docker_containers.html">Dockerize payload software</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/payload/spot_core_documentation.html">Pre-3.2 Spot CORE Documentation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_portainer.html">Configuring Docker containers in SpotCORE</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_cockpit.html">Spot CORE system management tool: Cockpit</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../docs/payload/spot_core_vnc.html">Spot CORE VNC</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/protos/README.html">API Protocol</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../docs/protos/style_guide.html">Style Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../protos/bosdyn/api/README.html">Proto Reference Guide</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../../protos/bosdyn/api/proto_reference.html">Protos</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/release_notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/boston-dynamics/spot-sdk">SDK Repository</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../README.html">Spot</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../README.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../index.html">Module code</a></li>
      <li class="breadcrumb-item active">bosdyn.client.estop</li>
      <li class="wy-breadcrumbs-aside">
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <h1>Source code for bosdyn.client.estop</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (c) 2023 Boston Dynamics, Inc.  All rights reserved.</span>
<span class="c1">#</span>
<span class="c1"># Downloading, reproducing, distributing or otherwise using the SDK Software</span>
<span class="c1"># is subject to the terms and conditions of the Boston Dynamics Software</span>
<span class="c1"># Development Kit License (20191101-BDSDK-SL).</span>

<span class="sd">&quot;&quot;&quot;For clients to the emergency stop (estop) service.&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">collections</span>
<span class="kn">import</span> <span class="nn">ctypes</span>
<span class="kn">import</span> <span class="nn">enum</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">queue</span>
<span class="kn">import</span> <span class="nn">threading</span>
<span class="kn">import</span> <span class="nn">time</span>

<span class="kn">from</span> <span class="nn">google.protobuf.duration_pb2</span> <span class="kn">import</span> <span class="n">Duration</span>

<span class="kn">from</span> <span class="nn">bosdyn.api</span> <span class="kn">import</span> <span class="n">estop_pb2</span><span class="p">,</span> <span class="n">estop_service_pb2_grpc</span>

<span class="kn">from</span> <span class="nn">.common</span> <span class="kn">import</span> <span class="p">(</span><span class="n">BaseClient</span><span class="p">,</span> <span class="n">common_header_errors</span><span class="p">,</span> <span class="n">error_factory</span><span class="p">,</span> <span class="n">handle_common_header_errors</span><span class="p">,</span>
                     <span class="n">handle_unset_status_error</span><span class="p">)</span>
<span class="kn">from</span> <span class="nn">.exceptions</span> <span class="kn">import</span> <span class="n">Error</span><span class="p">,</span> <span class="n">ResponseError</span><span class="p">,</span> <span class="n">RpcError</span><span class="p">,</span> <span class="n">TimedOutError</span>


<div class="viewcode-block" id="EstopResponseError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopResponseError">[docs]</a><span class="k">class</span> <span class="nc">EstopResponseError</span><span class="p">(</span><span class="n">ResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;General class of errors for Estop service.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="EndpointUnknownError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EndpointUnknownError">[docs]</a><span class="k">class</span> <span class="nc">EndpointUnknownError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The endpoint specified in the request is not registered.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="IncorrectChallengeResponseError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.IncorrectChallengeResponseError">[docs]</a><span class="k">class</span> <span class="nc">IncorrectChallengeResponseError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The challenge and/or response was incorrect.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="EndpointMismatchError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EndpointMismatchError">[docs]</a><span class="k">class</span> <span class="nc">EndpointMismatchError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Target endpoint did not match.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="ConfigMismatchError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.ConfigMismatchError">[docs]</a><span class="k">class</span> <span class="nc">ConfigMismatchError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Registered to the wrong configuration.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="InvalidEndpointError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.InvalidEndpointError">[docs]</a><span class="k">class</span> <span class="nc">InvalidEndpointError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;New endpoint was invalid.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="InvalidIdError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.InvalidIdError">[docs]</a><span class="k">class</span> <span class="nc">InvalidIdError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Tried to replace a EstopConfig, but provided bad ID.&quot;&quot;&quot;</span></div>


<div class="viewcode-block" id="MotorsOnError"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.MotorsOnError">[docs]</a><span class="k">class</span> <span class="nc">MotorsOnError</span><span class="p">(</span><span class="n">EstopResponseError</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;The operation is not allowed while motors are on.&quot;&quot;&quot;</span></div>


<span class="n">StopLevel</span> <span class="o">=</span> <span class="n">enum</span><span class="o">.</span><span class="n">IntEnum</span><span class="p">(</span><span class="s1">&#39;StopLevel&#39;</span><span class="p">,</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopStopLevel</span><span class="o">.</span><span class="n">items</span><span class="p">())</span>


<div class="viewcode-block" id="EstopClient"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient">[docs]</a><span class="k">class</span> <span class="nc">EstopClient</span><span class="p">(</span><span class="n">BaseClient</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Client to the estop service.&quot;&quot;&quot;</span>

    <span class="n">default_service_name</span> <span class="o">=</span> <span class="s1">&#39;estop&#39;</span>
    <span class="n">service_type</span> <span class="o">=</span> <span class="s1">&#39;bosdyn.api.EstopService&#39;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">&quot;EstopClient - PID: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getpid</span><span class="p">())):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">EstopClient</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">estop_service_pb2_grpc</span><span class="o">.</span><span class="n">EstopServiceStub</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>

<div class="viewcode-block" id="EstopClient.register"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.register">[docs]</a>    <span class="k">def</span> <span class="nf">register</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Register the endpoint in the target configuration.</span>

<span class="sd">        Args:</span>
<span class="sd">            target_config_id: The identification of the current configuration on the robot.</span>
<span class="sd">            endpoint: Estop endpoint.</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            estop_pb2.EstopEndpoint that has been registered.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_register_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RegisterEstopEndpoint</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span>
                         <span class="n">_new_endpoint_from_register_response</span><span class="p">,</span>
                         <span class="n">_register_endpoint_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.register_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.register_async">[docs]</a>    <span class="k">def</span> <span class="nf">register_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of register()&quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_register_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">RegisterEstopEndpoint</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span>
                               <span class="n">_new_endpoint_from_register_response</span><span class="p">,</span>
                               <span class="n">_register_endpoint_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.deregister"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.deregister">[docs]</a>    <span class="k">def</span> <span class="nf">deregister</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Deregister the endpoint in the target configuration.</span>

<span class="sd">        Args:</span>
<span class="sd">            target_config_id: The identification of the current configuration on the robot.</span>
<span class="sd">            endpoint: Estop endpoint.</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_deregister_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">DeregisterEstopEndpoint</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span>
                  <span class="n">_deregister_endpoint_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.deregister_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.deregister_async">[docs]</a>    <span class="k">def</span> <span class="nf">deregister_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of deregister()&quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_deregister_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">DeregisterEstopEndpoint</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span>
                               <span class="n">_deregister_endpoint_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                               <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.get_config"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.get_config">[docs]</a>    <span class="k">def</span> <span class="nf">get_config</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return the estop configuration of the robot.</span>

<span class="sd">        Args:</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            estop_pb2.EstopConfig the robot is currently using.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">GetEstopConfig</span><span class="p">,</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">GetEstopConfigRequest</span><span class="p">(),</span>
                         <span class="n">_active_config_from_config_response</span><span class="p">,</span> <span class="n">common_header_errors</span><span class="p">,</span>
                         <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.get_config_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.get_config_async">[docs]</a>    <span class="k">def</span> <span class="nf">get_config_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of get_config()&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">GetEstopConfig</span><span class="p">,</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">GetEstopConfigRequest</span><span class="p">(),</span>
                               <span class="n">_active_config_from_config_response</span><span class="p">,</span> <span class="n">common_header_errors</span><span class="p">,</span>
                               <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.set_config"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.set_config">[docs]</a>    <span class="k">def</span> <span class="nf">set_config</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Change the estop configuration of the robot.</span>

<span class="sd">        Args:</span>
<span class="sd">            config: New configuration to set.</span>
<span class="sd">            target_config_id: The identification of the current configuration on the robot.</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            estop_pb2.EstopConfig the robot is currently using.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigRequest</span><span class="p">(</span><span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span> <span class="n">target_config_id</span><span class="o">=</span><span class="n">target_config_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">SetEstopConfig</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_active_config_from_config_response</span><span class="p">,</span>
                         <span class="n">_set_config_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.set_config_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.set_config_async">[docs]</a>    <span class="k">def</span> <span class="nf">set_config_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">config</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of set_config()&quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigRequest</span><span class="p">(</span><span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span> <span class="n">target_config_id</span><span class="o">=</span><span class="n">target_config_id</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">SetEstopConfig</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_active_config_from_config_response</span><span class="p">,</span>
                               <span class="n">_set_config_error_from_response</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.get_status"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.get_status">[docs]</a>    <span class="k">def</span> <span class="nf">get_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return the estop status of the robot.</span>

<span class="sd">        Args:</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            estop_pb2.EstopSystemStatus from the server.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">GetEstopSystemStatus</span><span class="p">,</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">GetEstopSystemStatusRequest</span><span class="p">(),</span>
                         <span class="n">_estop_sys_status_from_response</span><span class="p">,</span> <span class="n">common_header_errors</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.get_status_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.get_status_async">[docs]</a>    <span class="k">def</span> <span class="nf">get_status_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of get_status()&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">GetEstopSystemStatus</span><span class="p">,</span>
                               <span class="n">estop_pb2</span><span class="o">.</span><span class="n">GetEstopSystemStatusRequest</span><span class="p">(),</span>
                               <span class="n">_estop_sys_status_from_response</span><span class="p">,</span> <span class="n">common_header_errors</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.check_in"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.check_in">[docs]</a>    <span class="k">def</span> <span class="nf">check_in</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="p">,</span> <span class="n">suppress_incorrect</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Check in with the estop system.</span>

<span class="sd">        Args:</span>
<span class="sd">            stop_level: Integer / enum representing desired stop level. See StopLevel enum.</span>
<span class="sd">            endpoint: The endpoint asserting the stop level.</span>
<span class="sd">            challenge: A previously received challenge from the server.</span>
<span class="sd">            response: A response to the &#39;challenge&#39; argument.</span>
<span class="sd">            suppress_incorrect: Set True to prevent an IncorrectChallengeResponseError from being</span>
<span class="sd">                raised when STATUS_INVALID is returned. Useful for the first check-in, before a</span>
<span class="sd">                challenge has been sent by the server.</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            A new challenge from the server.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_check_in_request</span><span class="p">(</span><span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
        <span class="n">err_from_resp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_choose_check_in_err_func</span><span class="p">(</span><span class="n">suppress_incorrect</span><span class="o">=</span><span class="n">suppress_incorrect</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">EstopCheckIn</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_challenge_from_check_in_response</span><span class="p">,</span>
                         <span class="n">err_from_resp</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopClient.check_in_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopClient.check_in_async">[docs]</a>    <span class="k">def</span> <span class="nf">check_in_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="p">,</span> <span class="n">suppress_incorrect</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
                       <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of check_in()&quot;&quot;&quot;</span>
        <span class="n">req</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_build_check_in_request</span><span class="p">(</span><span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="p">)</span>
        <span class="n">err_from_resp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_choose_check_in_err_func</span><span class="p">(</span><span class="n">suppress_incorrect</span><span class="o">=</span><span class="n">suppress_incorrect</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">call_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_stub</span><span class="o">.</span><span class="n">EstopCheckIn</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">_challenge_from_check_in_response</span><span class="p">,</span>
                               <span class="n">err_from_resp</span><span class="p">,</span> <span class="n">copy_request</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_build_check_in_request</span><span class="p">(</span><span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="p">):</span>
        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">endpoint</span><span class="p">,</span> <span class="n">EstopEndpoint</span><span class="p">):</span>
            <span class="n">endpoint</span> <span class="o">=</span> <span class="n">endpoint</span><span class="o">.</span><span class="n">to_proto</span><span class="p">()</span>
        <span class="k">return</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInRequest</span><span class="p">(</span><span class="n">stop_level</span><span class="o">=</span><span class="n">stop_level</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="n">endpoint</span><span class="p">,</span>
                                             <span class="n">challenge</span><span class="o">=</span><span class="n">challenge</span><span class="p">,</span> <span class="n">response</span><span class="o">=</span><span class="n">response</span><span class="p">)</span>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_build_register_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">):</span>
        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">endpoint</span><span class="p">,</span> <span class="n">EstopEndpoint</span><span class="p">):</span>
            <span class="n">endpoint</span> <span class="o">=</span> <span class="n">endpoint</span><span class="o">.</span><span class="n">to_proto</span><span class="p">()</span>
        <span class="n">req</span> <span class="o">=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointRequest</span><span class="p">(</span><span class="n">target_config_id</span><span class="o">=</span><span class="n">target_config_id</span><span class="p">,</span>
                                                     <span class="n">new_endpoint</span><span class="o">=</span><span class="n">endpoint</span><span class="p">)</span>
        <span class="n">req</span><span class="o">.</span><span class="n">target_endpoint</span><span class="o">.</span><span class="n">role</span> <span class="o">=</span> <span class="n">endpoint</span><span class="o">.</span><span class="n">role</span>
        <span class="k">return</span> <span class="n">req</span>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_build_deregister_request</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">):</span>
        <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">endpoint</span><span class="p">,</span> <span class="n">EstopEndpoint</span><span class="p">):</span>
            <span class="n">endpoint</span> <span class="o">=</span> <span class="n">endpoint</span><span class="o">.</span><span class="n">to_proto</span><span class="p">()</span>
        <span class="n">req</span> <span class="o">=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointRequest</span><span class="p">(</span><span class="n">target_config_id</span><span class="o">=</span><span class="n">target_config_id</span><span class="p">,</span>
                                                       <span class="n">target_endpoint</span><span class="o">=</span><span class="n">endpoint</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">req</span>

    <span class="nd">@staticmethod</span>
    <span class="k">def</span> <span class="nf">_choose_check_in_err_func</span><span class="p">(</span><span class="n">suppress_incorrect</span><span class="p">):</span>
        <span class="k">if</span> <span class="n">suppress_incorrect</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_check_in_error_from_response_no_incorrect</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">_check_in_error_from_response</span></div>


<div class="viewcode-block" id="EstopEndpoint"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint">[docs]</a><span class="k">class</span> <span class="nc">EstopEndpoint</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Endpoint in the software estop system.&quot;&quot;&quot;</span>

    <span class="c1"># This is an estop role required in every configuration.</span>
    <span class="n">REQUIRED_ROLE</span> <span class="o">=</span> <span class="s1">&#39;PDB_rooted&#39;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">client</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">estop_timeout</span><span class="p">,</span> <span class="n">role</span><span class="o">=</span><span class="n">REQUIRED_ROLE</span><span class="p">,</span> <span class="n">first_checkin</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
                 <span class="n">estop_cut_power_timeout</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">client</span> <span class="o">=</span> <span class="n">client</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">role</span> <span class="o">=</span> <span class="n">role</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span> <span class="o">=</span> <span class="n">estop_timeout</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="o">=</span> <span class="n">estop_cut_power_timeout</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_last_set_level</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_challenge</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_name</span> <span class="o">=</span> <span class="n">name</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_config_id</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Lock</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_locked_first_checkin</span> <span class="o">=</span> <span class="n">first_checkin</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">)</span>

    <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="s1"> (timeout </span><span class="si">{:.3}</span><span class="s1">s)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="k">return</span> <span class="s1">&#39;</span><span class="si">{}</span><span class="s1"> (timeout </span><span class="si">{:.3}</span><span class="s1">s, cut_power_timeout </span><span class="si">{:.3}</span><span class="s1">s)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">last_set_level</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_set_level</span>

    <span class="k">def</span> <span class="nf">_first_checkin</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_locked_first_checkin</span>

    <span class="k">def</span> <span class="nf">_set_first_checkin</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">val</span><span class="p">):</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_locked_first_checkin</span> <span class="o">=</span> <span class="n">val</span>

    <span class="k">def</span> <span class="nf">_set_challenge_without_exception_from_future</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fut</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Set challenge from the response in the future, if at all possible.&quot;&quot;&quot;</span>
        <span class="n">new_challenge</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="c1"># Try to get the FutureWrapper.result()</span>
            <span class="n">new_challenge</span> <span class="o">=</span> <span class="n">fut</span><span class="o">.</span><span class="n">result</span><span class="p">()</span>
        <span class="k">except</span> <span class="n">EstopResponseError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
            <span class="c1"># If this failed with an EstopResponseError, we can likely still extract a challenge.</span>
            <span class="n">new_challenge</span> <span class="o">=</span> <span class="n">_challenge_from_check_in_response</span><span class="p">(</span><span class="n">exc</span><span class="o">.</span><span class="n">response</span><span class="p">)</span>
        <span class="k">except</span> <span class="p">(</span><span class="n">Error</span><span class="p">)</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
            <span class="c1"># Otherwise, if it was a common ResponseError or an issue with the RPC itself,</span>
            <span class="c1"># we likely cannot.</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">&#39;Could not set challenge (error: </span><span class="si">%s</span><span class="s1">)&#39;</span><span class="p">,</span> <span class="n">exc</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)</span>

        <span class="c1"># If we got a new challenge, set it.</span>
        <span class="k">if</span> <span class="n">new_challenge</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">set_challenge</span><span class="p">(</span><span class="n">new_challenge</span><span class="p">)</span>

<div class="viewcode-block" id="EstopEndpoint.set_challenge"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.set_challenge">[docs]</a>    <span class="k">def</span> <span class="nf">set_challenge</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">challenge</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Thread-safe write to the challenge.&quot;&quot;&quot;</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_challenge</span> <span class="o">=</span> <span class="n">challenge</span></div>

<div class="viewcode-block" id="EstopEndpoint.get_challenge"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.get_challenge">[docs]</a>    <span class="k">def</span> <span class="nf">get_challenge</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Thread-safe read of the challenge.&quot;&quot;&quot;</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_challenge</span></div>

<div class="viewcode-block" id="EstopEndpoint.force_simple_setup"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.force_simple_setup">[docs]</a>    <span class="k">def</span> <span class="nf">force_simple_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Replaces the existing estop configuration with a single-endpoint configuration.&quot;&quot;&quot;</span>
        <span class="n">new_config</span> <span class="o">=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopConfig</span><span class="p">()</span>
        <span class="n">new_config_endpoint</span> <span class="o">=</span> <span class="n">new_config</span><span class="o">.</span><span class="n">endpoints</span><span class="o">.</span><span class="n">add</span><span class="p">()</span>
        <span class="n">new_config_endpoint</span><span class="o">.</span><span class="n">CopyFrom</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">to_proto</span><span class="p">())</span>

        <span class="n">active_config</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">get_config</span><span class="p">()</span>
        <span class="n">active_config</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">set_config</span><span class="p">(</span><span class="n">new_config</span><span class="p">,</span> <span class="n">active_config</span><span class="o">.</span><span class="n">unique_id</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span> <span class="o">=</span> <span class="n">active_config</span><span class="o">.</span><span class="n">endpoints</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">unique_id</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">active_config</span><span class="o">.</span><span class="n">unique_id</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.stop"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.stop">[docs]</a>    <span class="k">def</span> <span class="nf">stop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Issue a CUT stop level command to the robot, cutting motor power immediately.</span>

<span class="sd">        Args:</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            None. Will raise an error if RPC failed.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Stopping&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_CUT</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.settle_then_cut"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.settle_then_cut">[docs]</a>    <span class="k">def</span> <span class="nf">settle_then_cut</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Issue a SETTLE_THEN_CUT stop level. The robot will attempt to sit before cutting motor power.</span>

<span class="sd">        Args:</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            None. Will raise an error if RPC failed.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Stopping with SETTLE_THEN_CUT&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_SETTLE_THEN_CUT</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.allow"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.allow">[docs]</a>    <span class="k">def</span> <span class="nf">allow</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Issue a NONE stop level command to the robot, allowing motor power.</span>

<span class="sd">        Args:</span>
<span class="sd">            kwargs: Passed to underlying RPC. Example: timeout=5 to cancel the RPC after 5 seconds.</span>
<span class="sd">        Returns:</span>
<span class="sd">            None. Will raise an error if RPC failed.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Releasing&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_NONE</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.check_in_at_level"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.check_in_at_level">[docs]</a>    <span class="k">def</span> <span class="nf">check_in_at_level</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">level</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Check in at a specified level.</span>

<span class="sd">        Meant for internal use, but may be helpful for higher-level wrappers.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">set_challenge</span><span class="p">(</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">check_in</span><span class="p">(</span><span class="n">level</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_challenge</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">_response</span><span class="p">(),</span>
                                     <span class="n">suppress_incorrect</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_first_checkin</span><span class="p">(),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span>
        <span class="k">except</span> <span class="n">EstopResponseError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">set_challenge</span><span class="p">(</span><span class="n">_challenge_from_check_in_response</span><span class="p">(</span><span class="n">exc</span><span class="o">.</span><span class="n">response</span><span class="p">))</span>
            <span class="k">raise</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_last_set_level</span> <span class="o">=</span> <span class="n">level</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_set_first_checkin</span><span class="p">(</span><span class="kc">False</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.deregister"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.deregister">[docs]</a>    <span class="k">def</span> <span class="nf">deregister</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Deregister this endpoint from the configuration.&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Deregistering&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">deregister</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_config_id</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.register"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.register">[docs]</a>    <span class="k">def</span> <span class="nf">register</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Register this endpoint to the given configuration.&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Registering to </span><span class="si">%s</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">target_config_id</span><span class="p">)</span>
        <span class="n">new_endpoint</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">target_config_id</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span>
        <span class="c1"># If we were successful, update our config id and the rest of our data from the returned</span>
        <span class="c1"># endpoint protobuf.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_config_id</span> <span class="o">=</span> <span class="n">target_config_id</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">from_proto</span><span class="p">(</span><span class="n">new_endpoint</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Doing check-in to seed challenge...&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">stop</span><span class="p">()</span></div>

<div class="viewcode-block" id="EstopEndpoint.stop_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.stop_async">[docs]</a>    <span class="k">def</span> <span class="nf">stop_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of stop()&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Stopping (async)&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level_async</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_CUT</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.settle_then_cut_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.settle_then_cut_async">[docs]</a>    <span class="k">def</span> <span class="nf">settle_then_cut_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of settle_then_cut()&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Stopping with SETTLE_THEN_CUT (async)&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level_async</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_SETTLE_THEN_CUT</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.allow_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.allow_async">[docs]</a>    <span class="k">def</span> <span class="nf">allow_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of allow()&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Releasing (async)&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check_in_at_level_async</span><span class="p">(</span><span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_NONE</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.check_in_at_level_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.check_in_at_level_async">[docs]</a>    <span class="k">def</span> <span class="nf">check_in_at_level_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">level</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
        <span class="n">fut</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">check_in_async</span><span class="p">(</span><span class="n">level</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_challenge</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">_response</span><span class="p">(),</span>
                                         <span class="n">suppress_incorrect</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_first_checkin</span><span class="p">(),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
        <span class="n">fut</span><span class="o">.</span><span class="n">add_done_callback</span><span class="p">(</span><span class="k">lambda</span> <span class="n">fut</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_set_challenge_without_exception_from_future</span><span class="p">(</span><span class="n">fut</span><span class="p">))</span>
        <span class="n">fut</span><span class="o">.</span><span class="n">add_done_callback</span><span class="p">(</span><span class="k">lambda</span> <span class="n">fut</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_set_first_checkin</span><span class="p">(</span><span class="kc">False</span><span class="p">))</span>
        <span class="k">return</span> <span class="n">fut</span></div>

<div class="viewcode-block" id="EstopEndpoint.deregister_async"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.deregister_async">[docs]</a>    <span class="k">def</span> <span class="nf">deregister_async</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Async version of deregister()&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Deregistering (async)&#39;</span><span class="p">)</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">client</span><span class="o">.</span><span class="n">deregister_async</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_config_id</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopEndpoint.from_proto"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.from_proto">[docs]</a>    <span class="k">def</span> <span class="nf">from_proto</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">proto</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Set member variables based on given estop_pb2.EstopEndpoint.&quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_name</span> <span class="o">!=</span> <span class="n">proto</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;Changing name to </span><span class="si">%s</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">proto</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_name</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">name</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">role</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">role</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">timeout</span><span class="o">.</span><span class="n">seconds</span> <span class="o">+</span> <span class="n">proto</span><span class="o">.</span><span class="n">timeout</span><span class="o">.</span><span class="n">nanos</span> <span class="o">*</span> <span class="mf">1e-9</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">unique_id</span>
        <span class="k">if</span> <span class="n">proto</span><span class="o">.</span><span class="n">cut_power_timeout</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="o">=</span> <span class="kc">None</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="o">=</span> <span class="n">proto</span><span class="o">.</span><span class="n">cut_power_timeout</span><span class="o">.</span><span class="n">seconds</span> <span class="o">+</span> <span class="n">proto</span><span class="o">.</span><span class="n">cut_power_timeout</span><span class="o">.</span><span class="n">nanos</span> <span class="o">*</span> <span class="mf">1e-9</span></div>

<div class="viewcode-block" id="EstopEndpoint.to_proto"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopEndpoint.to_proto">[docs]</a>    <span class="k">def</span> <span class="nf">to_proto</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return estop_pb2.EstopEndpoint based on current member variables.&quot;&quot;&quot;</span>
        <span class="n">t_seconds</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span><span class="p">)</span>
        <span class="n">t_nanos</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">estop_timeout</span> <span class="o">-</span> <span class="n">t_seconds</span><span class="p">)</span> <span class="o">*</span> <span class="mf">1e9</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">return</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopEndpoint</span><span class="p">(</span><span class="n">role</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">role</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">,</span>
                                           <span class="n">unique_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span><span class="p">,</span>
                                           <span class="n">timeout</span><span class="o">=</span><span class="n">Duration</span><span class="p">(</span><span class="n">seconds</span><span class="o">=</span><span class="n">t_seconds</span><span class="p">,</span> <span class="n">nanos</span><span class="o">=</span><span class="n">t_nanos</span><span class="p">))</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">cpt_seconds</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span><span class="p">)</span>
            <span class="n">cpt_nanos</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">estop_cut_power_timeout</span> <span class="o">-</span> <span class="n">cpt_seconds</span><span class="p">)</span> <span class="o">*</span> <span class="mf">1e9</span><span class="p">)</span>
            <span class="k">return</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopEndpoint</span><span class="p">(</span>
                <span class="n">role</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">role</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">,</span> <span class="n">unique_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span><span class="p">,</span>
                <span class="n">timeout</span><span class="o">=</span><span class="n">Duration</span><span class="p">(</span><span class="n">seconds</span><span class="o">=</span><span class="n">t_seconds</span><span class="p">,</span> <span class="n">nanos</span><span class="o">=</span><span class="n">t_nanos</span><span class="p">),</span>
                <span class="n">cut_power_timeout</span><span class="o">=</span><span class="n">Duration</span><span class="p">(</span><span class="n">seconds</span><span class="o">=</span><span class="n">cpt_seconds</span><span class="p">,</span> <span class="n">nanos</span><span class="o">=</span><span class="n">cpt_nanos</span><span class="p">))</span></div>

    <span class="k">def</span> <span class="nf">_response</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Generate a response for self._challenge.&quot;&quot;&quot;</span>
        <span class="n">challenge</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_challenge</span><span class="p">()</span>
        <span class="k">return</span> <span class="kc">None</span> <span class="k">if</span> <span class="n">challenge</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">response_from_challenge</span><span class="p">(</span><span class="n">challenge</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">unique_id</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return the _unique_id. Should be used as read-only.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_unique_id</span></div>


<div class="viewcode-block" id="EstopKeepAlive"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive">[docs]</a><span class="k">class</span> <span class="nc">EstopKeepAlive</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Wraps an EstopEndpoint to do periodic check-ins, keeping software estop from timing out.</span>

<span class="sd">    This is intended to be the common implementation of both periodic checking-in and one-time</span>
<span class="sd">    check-ins. See the command line utility and the &quot;Big Red Button&quot; application for examples.</span>

<span class="sd">    You should not access any of the &quot;private&quot; members, or the wrapped endpoint.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">endpoint</span><span class="p">,</span> <span class="n">rpc_timeout_seconds</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">rpc_interval_seconds</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
                 <span class="n">keep_running_cb</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">max_status_queue_size</span><span class="o">=</span><span class="mi">20</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Kicks off periodic check-in on a thread.&quot;&quot;&quot;</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span> <span class="o">=</span> <span class="n">endpoint</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Lock</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_end_check_in_signal</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Event</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_desired_stop_level</span> <span class="o">=</span> <span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_NONE</span>
        <span class="c1"># By default, only let our RPCs last as long as the estop timeout.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_rpc_timeout</span> <span class="o">=</span> <span class="n">rpc_timeout_seconds</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">estop_timeout</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_check_in_period</span> <span class="o">=</span> <span class="n">rpc_interval_seconds</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">estop_timeout</span> <span class="o">/</span> <span class="mf">3.0</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_rpc_timeout</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Invalid rpc_timeout_seconds &quot;</span><span class="si">{}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_rpc_timeout</span><span class="p">))</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_check_in_period</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Invalid rpc_interval_seconds &quot;</span><span class="si">{}</span><span class="s1">&quot;&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_check_in_period</span><span class="p">))</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">_keep_running</span> <span class="o">=</span> <span class="n">keep_running_cb</span> <span class="ow">or</span> <span class="p">(</span><span class="k">lambda</span><span class="p">:</span> <span class="kc">True</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;New </span><span class="si">%s</span><span class="s1"> for endpoint &quot;</span><span class="si">%s</span><span class="s1">&quot;&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="p">)</span>

        <span class="bp">self</span><span class="o">.</span><span class="n">status_queue</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">Queue</span><span class="p">(</span><span class="n">maxsize</span><span class="o">=</span><span class="n">max_status_queue_size</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_update_status</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">KeepAliveStatus</span><span class="o">.</span><span class="n">OK</span><span class="p">)</span>

        <span class="c1"># Do an initial check-in, and just log any errors that occur.</span>
        <span class="c1"># This lets us get a challenge from the estop system, so we can begin using</span>
        <span class="c1"># valid challenge/response pairs.</span>
        <span class="k">try</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_check_in</span><span class="p">()</span>
        <span class="c1">#pylint: disable=broad-except</span>
        <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">&#39;Estop initial check-in exception:</span><span class="se">\n</span><span class="si">{}</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">exc</span><span class="p">))</span>

        <span class="c1"># Configure the thread to do check-ins, and begin checking in.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_thread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_periodic_check_in</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_thread</span><span class="o">.</span><span class="n">daemon</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_thread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>

    <span class="k">def</span> <span class="fm">__enter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span>

    <span class="k">def</span> <span class="fm">__exit__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exc_type</span><span class="p">,</span> <span class="n">exc_val</span><span class="p">,</span> <span class="n">exc_tb</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">shutdown</span><span class="p">()</span>

<div class="viewcode-block" id="EstopKeepAlive.shutdown"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive.shutdown">[docs]</a>    <span class="k">def</span> <span class="nf">shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Shutting down&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_end_periodic_check_in</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_thread</span><span class="o">.</span><span class="n">join</span><span class="p">()</span></div>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">last_set_level</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">last_set_level</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">logger</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">logger</span>

<div class="viewcode-block" id="EstopKeepAlive.allow"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive.allow">[docs]</a>    <span class="k">def</span> <span class="nf">allow</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_desired_stop_level</span> <span class="o">=</span> <span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_NONE</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_check_in</span><span class="p">()</span></div>

<div class="viewcode-block" id="EstopKeepAlive.settle_then_cut"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive.settle_then_cut">[docs]</a>    <span class="k">def</span> <span class="nf">settle_then_cut</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_desired_stop_level</span> <span class="o">=</span> <span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_SETTLE_THEN_CUT</span>
        <span class="c1"># In the case of stopping, we want the RPC to timeout only after the estop itself has</span>
        <span class="c1"># timed out. This handles the case where a user calls settle_then_cut() with :</span>
        <span class="c1">#  - a very low self._rpc_timeout and</span>
        <span class="c1">#  - a very large check-in period and</span>
        <span class="c1">#  - doesn&#39;t handle RPC timeout errors themselves.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_check_in</span><span class="p">(</span><span class="n">rpc_timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">estop_timeout</span><span class="p">)</span></div>

<div class="viewcode-block" id="EstopKeepAlive.stop"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive.stop">[docs]</a>    <span class="k">def</span> <span class="nf">stop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_desired_stop_level</span> <span class="o">=</span> <span class="n">StopLevel</span><span class="o">.</span><span class="n">ESTOP_LEVEL_CUT</span>
        <span class="c1"># In the case of stopping, we want the RPC to timeout only after the estop itself has</span>
        <span class="c1"># timed out. This handles the case where a user calls stop() with :</span>
        <span class="c1">#  - a very low self._rpc_timeout and</span>
        <span class="c1">#  - a very large check-in period and</span>
        <span class="c1">#  - doesn&#39;t handle RPC timeout errors themselves.</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_check_in</span><span class="p">(</span><span class="n">rpc_timeout</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">estop_timeout</span><span class="p">)</span></div>

    <span class="k">def</span> <span class="nf">_end_periodic_check_in</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Stop checking into the robot estop system.&quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Stopping check-in&#39;</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_end_check_in_signal</span><span class="o">.</span><span class="n">set</span><span class="p">()</span>

    <span class="k">def</span> <span class="nf">_error</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">msg</span><span class="p">,</span> <span class="n">exception</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">disable</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Handle an error message; optionally disable the application.</span>

<span class="sd">        GUI applications should override this function, to make sure the error_msg gets to the GUI.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_update_status</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">KeepAliveStatus</span><span class="o">.</span><span class="n">ERROR</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">disable</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_end_periodic_check_in</span><span class="p">()</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_update_status</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">KeepAliveStatus</span><span class="o">.</span><span class="n">DISABLED</span><span class="p">,</span> <span class="n">msg</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">_ok</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Handle an ok message.</span>

<span class="sd">        GUI applications should override this function, to make sure the error_msg gets to the GUI.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">_update_status</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">KeepAliveStatus</span><span class="o">.</span><span class="n">OK</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s1">&#39;Check-in successful&#39;</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">_update_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">status</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Update the estop_keep_alive status by populating the queue, clearing old entries if the queue is full.</span>

<span class="sd">        Note: this method is not thread safe because if called by multiple different threads it could</span>
<span class="sd">        create a race condition which will raise a FullQueue exception. The EstopKeepAlive only uses</span>
<span class="sd">        this in a single background thread for the _periodic_check_in method.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status_queue</span><span class="o">.</span><span class="n">full</span><span class="p">():</span>
            <span class="c1"># Remove an element to clear out the status queue for the new element.</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">status_queue</span><span class="o">.</span><span class="n">get_nowait</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">status_queue</span><span class="o">.</span><span class="n">put</span><span class="p">((</span><span class="n">status</span><span class="p">,</span> <span class="n">msg</span><span class="p">),</span> <span class="n">block</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">_check_in</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">rpc_timeout</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Check in, optionally specifying a non-standard RPC timeout.&quot;&quot;&quot;</span>
        <span class="n">rpc_timeout</span> <span class="o">=</span> <span class="n">rpc_timeout</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_rpc_timeout</span>
        <span class="k">with</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lock</span><span class="p">:</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">check_in_at_level</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_desired_stop_level</span><span class="p">,</span> <span class="n">timeout</span><span class="o">=</span><span class="n">rpc_timeout</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">_periodic_check_in</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Send estop API CheckIn messages to robot estop system in loop.&quot;&quot;&quot;</span>
        <span class="c1"># Sleep for portion of the timeout (and convert from nanoseconds to seconds)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;Starting estop check-in&#39;</span><span class="p">)</span>
        <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
            <span class="c1"># Include the time it takes to execute keep_running, in case it takes a significant</span>
            <span class="c1"># portion of our check in period.</span>
            <span class="n">exec_start</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
            <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_keep_running</span><span class="p">():</span>
                <span class="k">break</span>
            <span class="k">try</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_check_in</span><span class="p">()</span>
            <span class="k">except</span> <span class="n">TimedOutError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_error</span><span class="p">(</span><span class="s1">&#39;RPC took longer than </span><span class="si">{:.2f}</span><span class="s1"> seconds&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_rpc_timeout</span><span class="p">),</span>
                            <span class="n">exception</span><span class="o">=</span><span class="n">exc</span><span class="p">)</span>
            <span class="k">except</span> <span class="n">RpcError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_error</span><span class="p">(</span>
                    <span class="s1">&#39;Transport exception during check-in:</span><span class="se">\n</span><span class="si">{}</span><span class="se">\n</span><span class="s1">&#39;</span>
                    <span class="s1">&#39;    (resuming check-in)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="n">exception</span><span class="o">=</span><span class="n">exc</span><span class="p">)</span>
            <span class="k">except</span> <span class="n">EndpointUnknownError</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
                <span class="c1"># Disable ourself to show we cannot estop any longer.</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_error</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="n">exception</span><span class="o">=</span><span class="n">exc</span><span class="p">,</span> <span class="n">disable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

            <span class="c1"># We really do want to catch anything.</span>
            <span class="c1">#pylint: disable=broad-except</span>
            <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">warning</span><span class="p">((</span><span class="s1">&#39;Generic exception during check-in:</span><span class="se">\n</span><span class="si">{}</span><span class="se">\n</span><span class="s1">&#39;</span>
                                     <span class="s1">&#39;    (resuming check-in)&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">exc</span><span class="p">))</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="c1"># No errors!</span>
                <span class="bp">self</span><span class="o">.</span><span class="n">_ok</span><span class="p">()</span>

            <span class="c1"># How long did the RPC and processing of said RPC take?</span>
            <span class="n">exec_sec</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">exec_start</span>

            <span class="c1"># Block and wait for the stop signal. If we receive it within the check-in period,</span>
            <span class="c1"># leave the loop. This check must be at the end of the loop!</span>
            <span class="c1"># Wait up to self._check_in_period seconds, minus the RPC processing time.</span>
            <span class="c1"># (values &lt; 0 are OK and will return immediately)</span>
            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_end_check_in_signal</span><span class="o">.</span><span class="n">wait</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_check_in_period</span> <span class="o">-</span> <span class="n">exec_sec</span><span class="p">):</span>
                <span class="k">break</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s1">&#39;Estop check-in stopped&#39;</span><span class="p">)</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">endpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return the _endpoint. Should be used as read-only.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span>

    <span class="nd">@property</span>
    <span class="k">def</span> <span class="nf">client</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w">        </span><span class="sd">&quot;&quot;&quot;Return the _endpoint.client. Should be used as read-only.&quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_endpoint</span><span class="o">.</span><span class="n">client</span>

<div class="viewcode-block" id="EstopKeepAlive.KeepAliveStatus"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.EstopKeepAlive.KeepAliveStatus">[docs]</a>    <span class="k">class</span> <span class="nc">KeepAliveStatus</span><span class="p">(</span><span class="n">enum</span><span class="o">.</span><span class="n">Enum</span><span class="p">):</span>
        <span class="n">OK</span> <span class="o">=</span> <span class="mi">0</span>
        <span class="n">ERROR</span> <span class="o">=</span> <span class="mi">1</span>
        <span class="n">DISABLED</span> <span class="o">=</span> <span class="mi">2</span></div></div>


<div class="viewcode-block" id="is_estopped"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.is_estopped">[docs]</a><span class="k">def</span> <span class="nf">is_estopped</span><span class="p">(</span><span class="n">estop_client</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Returns true if robot is estopped, false otherwise.</span>

<span class="sd">    Raises:</span>
<span class="sd">        RpcError: Problem communicating with the robot</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">response</span> <span class="o">=</span> <span class="n">estop_client</span><span class="o">.</span><span class="n">get_status</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">stop_level</span> <span class="o">!=</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">ESTOP_LEVEL_NONE</span></div>


<div class="viewcode-block" id="response_from_challenge"><a class="viewcode-back" href="../../../python/bosdyn-client/src/bosdyn/client/estop.html#bosdyn.client.estop.response_from_challenge">[docs]</a><span class="k">def</span> <span class="nf">response_from_challenge</span><span class="p">(</span><span class="n">challenge</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">ctypes</span><span class="o">.</span><span class="n">c_ulonglong</span><span class="p">(</span><span class="o">~</span><span class="n">challenge</span><span class="p">)</span><span class="o">.</span><span class="n">value</span></div>


<span class="n">_CHECK_IN_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span><span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">ResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_CHECK_IN_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInResponse</span><span class="o">.</span><span class="n">STATUS_OK</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInResponse</span><span class="o">.</span><span class="n">STATUS_ENDPOINT_UNKNOWN</span><span class="p">:</span>
        <span class="p">(</span><span class="n">EndpointUnknownError</span><span class="p">,</span> <span class="n">EndpointUnknownError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInResponse</span><span class="o">.</span><span class="n">STATUS_INCORRECT_CHALLENGE_RESPONSE</span><span class="p">:</span>
        <span class="p">(</span><span class="n">IncorrectChallengeResponseError</span><span class="p">,</span> <span class="n">IncorrectChallengeResponseError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
<span class="p">})</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_check_in_error_from_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return an exception based on response from EstopCheckIn RPC, None if no error.&quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_CHECK_IN_STATUS_TO_ERROR</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_check_in_error_from_response_no_incorrect</span><span class="p">(</span><span class="n">resp</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return an exception based on response from EstopCheckIn RPC, ignoring incorrect chal/resp&quot;&quot;&quot;</span>
    <span class="k">if</span> <span class="n">resp</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">estop_pb2</span><span class="o">.</span><span class="n">EstopCheckInResponse</span><span class="o">.</span><span class="n">STATUS_INCORRECT_CHALLENGE_RESPONSE</span><span class="p">:</span>
        <span class="k">return</span> <span class="kc">None</span>
    <span class="k">return</span> <span class="n">_check_in_error_from_response</span><span class="p">(</span><span class="n">resp</span><span class="p">)</span>


<span class="n">_SET_CONFIG_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span><span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">ResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_SET_CONFIG_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigResponse</span><span class="o">.</span><span class="n">STATUS_SUCCESS</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigResponse</span><span class="o">.</span><span class="n">STATUS_INVALID_ID</span><span class="p">:</span> <span class="p">(</span><span class="n">InvalidIdError</span><span class="p">,</span> <span class="n">InvalidIdError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigResponse</span><span class="o">.</span><span class="n">STATUS_MOTORS_ON</span><span class="p">:</span> <span class="p">(</span><span class="n">MotorsOnError</span><span class="p">,</span> <span class="n">MotorsOnError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
<span class="p">})</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_set_config_error_from_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return an exception based on response from SetEstopConfig RPC, None if no error.&quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">estop_pb2</span><span class="o">.</span><span class="n">SetEstopConfigResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_SET_CONFIG_STATUS_TO_ERROR</span><span class="p">)</span>


<span class="n">_DEREGISTER_ENDPOINT_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span><span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">ResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_DEREGISTER_ENDPOINT_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_SUCCESS</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_ENDPOINT_MISMATCH</span><span class="p">:</span>
        <span class="p">(</span><span class="n">EndpointMismatchError</span><span class="p">,</span> <span class="n">EndpointMismatchError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_CONFIG_MISMATCH</span><span class="p">:</span>
        <span class="p">(</span><span class="n">ConfigMismatchError</span><span class="p">,</span> <span class="n">ConfigMismatchError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_MOTORS_ON</span><span class="p">:</span>
        <span class="p">(</span><span class="n">MotorsOnError</span><span class="p">,</span> <span class="n">MotorsOnError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
<span class="p">})</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_deregister_endpoint_error_from_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return an exception based on response from DeregisterEstopEndpoint RPC, None if no error.&quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">estop_pb2</span><span class="o">.</span><span class="n">DeregisterEstopEndpointResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_DEREGISTER_ENDPOINT_STATUS_TO_ERROR</span><span class="p">)</span>


<span class="n">_REGISTER_ENDPOINT_STATUS_TO_ERROR</span> <span class="o">=</span> <span class="n">collections</span><span class="o">.</span><span class="n">defaultdict</span><span class="p">(</span><span class="k">lambda</span><span class="p">:</span> <span class="p">(</span><span class="n">ResponseError</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span>
<span class="n">_REGISTER_ENDPOINT_STATUS_TO_ERROR</span><span class="o">.</span><span class="n">update</span><span class="p">({</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_SUCCESS</span><span class="p">:</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_ENDPOINT_MISMATCH</span><span class="p">:</span>
        <span class="p">(</span><span class="n">EndpointMismatchError</span><span class="p">,</span> <span class="n">EndpointMismatchError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_CONFIG_MISMATCH</span><span class="p">:</span>
        <span class="p">(</span><span class="n">ConfigMismatchError</span><span class="p">,</span> <span class="n">ConfigMismatchError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
    <span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointResponse</span><span class="o">.</span><span class="n">STATUS_INVALID_ENDPOINT</span><span class="p">:</span>
        <span class="p">(</span><span class="n">InvalidEndpointError</span><span class="p">,</span> <span class="n">InvalidEndpointError</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">),</span>
<span class="p">})</span>


<span class="nd">@handle_common_header_errors</span>
<span class="nd">@handle_unset_status_error</span><span class="p">(</span><span class="n">unset</span><span class="o">=</span><span class="s1">&#39;STATUS_UNKNOWN&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_register_endpoint_error_from_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
<span class="w">    </span><span class="sd">&quot;&quot;&quot;Return an exception based on response from RegisterEstopEndpoint RPC, None if no error.&quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="n">error_factory</span><span class="p">(</span><span class="n">response</span><span class="p">,</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span><span class="p">,</span>
                         <span class="n">status_to_string</span><span class="o">=</span><span class="n">estop_pb2</span><span class="o">.</span><span class="n">RegisterEstopEndpointResponse</span><span class="o">.</span><span class="n">Status</span><span class="o">.</span><span class="n">Name</span><span class="p">,</span>
                         <span class="n">status_to_error</span><span class="o">=</span><span class="n">_REGISTER_ENDPOINT_STATUS_TO_ERROR</span><span class="p">)</span>


<span class="k">def</span> <span class="nf">_new_endpoint_from_register_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">new_endpoint</span>


<span class="k">def</span> <span class="nf">_active_config_from_config_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">active_config</span>


<span class="k">def</span> <span class="nf">_challenge_from_check_in_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">challenge</span>


<span class="k">def</span> <span class="nf">_estop_sys_status_from_response</span><span class="p">(</span><span class="n">response</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">status</span>
</pre></div>

           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
      
      &copy; Copyright 2025 Boston Dynamics. All rights reserved.
      <a href="https://www.bostondynamics.com/privacy-policy">Privacy Policy</a> | 
      <a href="https://www.bostondynamics.com/terms">Terms of Use</a>

    </p>
  </div> 

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(false);
      });
  </script>
    <!-- Theme Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-XXXXXXX-1', {
          'anonymize_ip': false,
      });
    </script> 

</body>
</html>